Skip to content

Conversation

@Tulsishah
Copy link
Collaborator

@Tulsishah Tulsishah commented Jan 19, 2026

Description

This PR updates the LookUpChild logic to support the deprecation of the typeCache by merging its functionality into a single, unified statCache.

Key Updates:

  1. Unified Cache Logic: Modifies LookUpChild to determine object types directly from metadata in the statCache
  2. Feature Flag: Introduces the EnableTypeCacheDeprecation configuration flag to safely toggle this new behavior
  3. Cache-Only Phase: Implements a two-phase lookup that checks the local cache first before falling back to the GCS backend, optimizing performance.

Link to the issue in case of a bug fix.

b/476918868

Testing details

  1. Manual - NA
  2. Unit tests - Added
  3. Integration tests - Automated, also tested with type cache deprecation enabled

Any backward incompatible change? If so, please explain.

@Tulsishah Tulsishah added execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. type-cache-deprecation labels Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 85.07463% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.47%. Comparing base (0cb531b) to head (e137a4c).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
internal/fs/inode/dir.go 85.71% 4 Missing and 5 partials ⚠️
cmd/mount.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4290      +/-   ##
==========================================
+ Coverage   83.38%   83.47%   +0.09%     
==========================================
  Files         162      162              
  Lines       19426    19469      +43     
==========================================
+ Hits        16198    16252      +54     
+ Misses       2628     2617      -11     
  Partials      600      600              
Flag Coverage Δ
unittests 83.47% <85.07%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tulsishah
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces changes related to the deprecation of the type cache, primarily by adding a new configuration flag EnableTypeCacheDeprecation and modifying lookup functions to conditionally use this flag. The changes involve passing this flag down to various GCS operations and introducing a metadataCacheTtlSecs field for future caching logic. New test cases have been added to cover the deprecated type cache path for files and directories. However, there are several areas that require attention, including inconsistencies in passing fetchOnlyFromCache to helper functions, incorrect error handling for cache misses in cache-only lookups, a missing lookup path for implicit directories when the type cache is deprecated, and redeclaration issues for err and result variables. Additionally, the ListPrefix utility hardcodes the IsTypeCacheDeprecated flag to false, which might lead to unintended behavior. The new tests also lack coverage for cache-only lookup scenarios and CacheMissError handling.

@Tulsishah Tulsishah marked this pull request as ready for review January 21, 2026 05:22
@Tulsishah Tulsishah requested a review from a team as a code owner January 21, 2026 05:22
@Tulsishah Tulsishah requested a review from raj-prince January 21, 2026 05:22
@github-actions github-actions bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jan 21, 2026
@Tulsishah Tulsishah requested review from vadlakondaswetha and removed request for raj-prince January 21, 2026 05:22
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Tulsishah, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the object type lookup mechanism by deprecating the dedicated typeCache and integrating its responsibilities into the existing statCache. The changes introduce a feature flag for managing this transition and implement a more efficient two-phase lookup strategy, prioritizing local cache access to improve performance and streamline object metadata handling.

Highlights

  • Unified Cache Logic: The LookUpChild logic has been updated to determine object types directly from metadata stored in the statCache, effectively merging the functionality of the deprecated typeCache.
  • Feature Flag Implementation: A new configuration flag, EnableTypeCacheDeprecation, has been introduced. This flag allows for safe toggling and controlled rollout of the new cache behavior.
  • Two-Phase Lookup Optimization: A two-phase lookup mechanism is now in place. It first attempts to retrieve entries from the local cache and only falls back to the GCS backend if a cache miss occurs, optimizing performance.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Tulsishah Tulsishah requested a review from ashmeenkaur January 21, 2026 05:22
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively implements the deprecation of typeCache by integrating its functionality into the statCache, controlled by the EnableTypeCacheDeprecation feature flag. The changes in LookUpChild to support a two-phase lookup (cache-first, then GCS fallback) are well-implemented. The accompanying tests are comprehensive and cover various scenarios, including cache hits, cache misses, and different object types for both hierarchical and non-hierarchical buckets.

My main feedback is to refactor a duplicated block of code in LookUpChild to improve maintainability. Overall, this is a solid contribution towards unifying the caching logic.

@github-actions
Copy link

Hi @vadlakondaswetha, @ashmeenkaur, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

1 similar comment
@github-actions
Copy link

Hi @vadlakondaswetha, @ashmeenkaur, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@Tulsishah Tulsishah removed the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jan 25, 2026
MaxResults: 1,
Prefix: name.GcsObjectName(),
MaxResults: 1,
IsTypeCacheDeprecated: isTypeCacheDeprecated,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is typeCacheDeprecated flag being passed as part of listObjects request>?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to enable new caching logic in fast stat bucket
ref:

if req.IsTypeCacheDeprecated {

Prefix: d.Name().GcsObjectName(),
ContinuationToken: tok,
MaxResults: limit + 1, // to exclude itself
IsTypeCacheDeprecated: d.isEnableTypeCacheDeprecation,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. we should not pass flag values as part of request object for every call.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this then with list call caching will happen correctly with type cache deprecation otherwise implicit directories will not get cached correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. type-cache-deprecation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants